//2009/08/22 22:34:24
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class AttendanceShort
{
public:
    vector <string> shortList(vector <string> names, vector <string> attendance)
    {
        vector<string> v;
        for (int i=0; i<names.size(); i++)
        {
            //v.push_back(names[i]);
            int cnt = 0;
            int pst = 0;
            for (int j=0; j<attendance[i].size(); j++)
            {
                if (attendance[i][j] == 'M') continue;
                if (attendance[i][j] == 'P')
                {
                    cnt ++;
                    pst ++;
                }
                else
                    cnt ++;
            }
            double temp = 100.0 * pst / cnt;
            if (temp < 75.0)
                v.push_back(names[i]);
        }
		return v;
    }
};
